Refactor contact template