Make the runner work recursively
Reduce complexity of determine_next_step
rubocop