turn a connect middleware into a replaceable, deletable middleware