Changed extract code so that it optimizes updates of records where content