refactored to allow WS URL as a config option