Refactor so rubocop finds no errors on itself