Refactor form