redefined channel definition, general code cleanup