enhance local_path config option and tighten up code