Refactored to different classes and added form persistence