Refactored to support controller and route inspection.