Cleanup template stuff