add -norun mode and restructure config/flagsconfig