rework so can easily emit all types