maybe change the test to whether 'value' in g_def or 'path' in g_def: so that the if 'path' not in g_def test can be dropped?
maybe change the test to if 'value' in g_def or 'path' in g_def: so that the if 'path' not in g_def test can be removed?