Refactored move.rb