Changed to definining methods of constructors on their prototype