Updated and separated class responsibilities, refactored, and reformatted