Rework indices source for cleaner implementation