(#112) - don't serialize emitted value
(#112) - simplify the sorting process a bit