breaking out code into classes