move optional and inverse test in deep.Route