clean up the layout templates for frontend use