refactoring repository. conversation doesn't work yet