begin class for writing key-value storage