Refactor into more classes