refactored socketlistener for readability