refactored to own class