refactored or.rb