optimize key value storage