I did it the way it was done in bitcask, for better or worse I guess.