cleanup: function names, error handler

- renamed cleanSocket function to socket_clean
- optimzed error handling (reduced repeats of "ERROR: "
- added orphaned argument error