split code into classes