refactor the config setup, restructured classes