Improve the code, remake the message layer, split code, rename some variable, try to be more clear