pre middleman cleanup