Separate out code for operating on channels.