Replace boilerplate guess_[component]_location() functions with a single guess_location(component_name)