refactored config and more