work in progress - refactoring dynamic form