sophia: index planner refactoring