improved config file and script file handling