WIP: move chans to non-global scope