Add discoverd client interface, refactor a bit