Almost finish port to netty 4