separate out channel code from fscmd, and improve housekeeping