More refactoring and added "loadConfig" script.