form refactor