refactor form