refactoring: extract classes