Added more flexible indexing with Cache