refactored class