Refactored forms and added more tests