Broke the code into multiple classes