moved functions in object to prototype