Refactoring of update method and add some documentations