Put updates code into own functions