Polish programming.

Polish programming styles. Connection works, tested on basic client.