Move View functions to the prototype