Minor code changes

Mostly to clean up some stuff and make socket code more visually
appealing