broke some logic from #next_move into separate methods