simplified code with rubocop cleanup