Refactor updatePreviously