Refactored socket factory
Removed addListener method. On should be used instead