Cleaning up templates