Moved routing logic from console to engine