helps build and organize keys for leveldb