Refactor, fix lost socket ref possibility with auth, 0.4.0