Refactor redundant code in link_local_settings()