switch from explicit hash to index