Broke up the code into separate objects.