improve config so you can use it with a socket optionally