adds rubocop and improves code