Implemented full pattern-matched routing.