Modified config file loading, refactored