Make code more solid
Simplify internal protocol server logic