Creating functions inside the render method