Some cleanup of template