Further improve variable indexing