Moved update related code into a class to be re-used with extension updates.