Add IndexManager abstraction.
Minor refactoring.