Refactor `StreamIdGenerator` and `MultiWriterIdGenerator` to have the same interface.