Refactored IndexGraph