REFACTOR index and config