pulled out updates into their own middleware