fully tested middleware