Simplified the render functionality and added tests