content index tests and code refactoring