Refactor + channel api & tcp update