some quick refactoring to appease rubocop