Refactor the lookup and update methods

#refactor #lesson5