Refactored code, added form feedback generator.