refactor and fix incorrect config file specified