Added types so others dont have to include
refactored socket a bit