refactor and rubocop