Reduce complexity of determine_next_step