refactored, extracted a class