Updated the Middleware layer to be a bit more elegant
Documentation Update for Middleware