allow input and profile in cfg file, more cleanup