Rework update routine a bit

Explanations in comments there.