Use as middleware filter, therefore decoupling from static middleware