refactor repo.go