make this work with external config and recent changes.