Refactor SocketHandler.
Merge branch 'develop'