RUBY-550 socket util module and refactoring