clean up middleware file a bit
tests for rendering nothing or meta