fix null bug
allow passing in host/port
get rid of some old code