Moving helper functions to prototype instead of assigning on each instance