refactor self_config