introduce a way to define custom function into route