cleaning up the Socket.php file and some other tweaks

Signed-off-by: Bruno Gaspar <brunofgaspar1@gmail.com>