Move functions to prototype