Refactoring code and implemented updating note