Make render function part of prototype