refactored controller, add form working