add zeroconf and small refactor