refactored to different class