refine channels and add unit tests