Refactored and Rubocop'd