Refactor UPnp service management
Optimize getLocalAddress method