could we abstract rendering part to the separate file and just leave function call here - similar to building crud routes for API?