[Refactor] Refactor all channel related functions.