Use repository in update