refactoring and Content index tests