Quite a few changes to incorporate rubocop