clean up and organize templates