Refactoring forms and submission (part 1)