move static channelmanager functions into their own file