phanton: cleanup stream handling