Made sub-functions members of the class instead