Basic cleanup of template