Refactor form templates