Nudge: refactor and simplify directionMap logic