Update record and refactoring