dhcp config generation - fixes and optimization