Better index handling