Cleaned up channel and dictionary code a bit