Move definition of doClear() out of class definition
This enables the usage of things defined after the class.