refactor local hostname processing on startup