id and repo refactor