generalized key id indexing