This is way more complicated than it should be, partly as a consequence of treating source/sink/processor differently