rework the config construction