clean up edit template