Incorporating most of rubocop's suggestions