converted to node module to support using an existing discovery instance