refactoring update() and checkout() methods