Splitting update code into method