refactored methods into their own class