Modified a lot according to netty 3.6 manual