refactor gear.rb