remove unnecessary channel and some other methods, and added more comments.