Moved controller detection logic to the routing engine