make catalog connection work
clean up a bit