added rubocop, refactored for style