improved route matching