refactor sstable_writer