templates cleanup