moved matching path/method in router from macro to function