Refactored methods into a class