Rework implementation of non-deteminism