Remove refs to ENV in middleware