Added indexBy method