NXP-14904 Use vhosthelper to compute serverUrl, remove some duplicated code