Moving updating procedure to local