refactored methods into module