Refactor into separate classes