Separated code into classes