form edit refactor