seperated code into classes