form widget refactoring