re-factored Fig configuration parser