Housekeeping on the template