Extraction middleware to fix #2.
0.3.1