perf: reduce executed logic in routing