refactoring ContentRepository to provide a better and flexible way to query