more refactoring cleanup on StaticMiddleware.