Implements a better wrapper and socket interface