Refactor index to use built-in methods.

MORE CHOWDAH