refactored routes and form creation logic in homecontroller