Use unemit to implement toVector