move middleware to own test