Make the repository implementation generic