Simplify logic for obtaining possible directions.