Refactoring on index module