declarative middleware