Refactor into multiple classes