refactor methods into single responsibilities