refactored command in repositories
used collections distinct method