Refactoring index tasks