Separating code into classes