update bufferedchannel and remove unused code