style & api changes to socket