moved channel stuff to util, changed it a bit