refactor mock routing

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>