make nifty middleware.