rewrite [Repository] update code