Splitting logic into more classes making things clearer