Cleans up templates