Extensive code clean-up with rubocop