Fixes #4 by supporting additional middleware