test for editFormController; refactoring