refactored code into a class