Replace generic socket with an interface.