Editing correctly populates template data.
Plus a tidy up.