split the render functions into more functions