factor cmdline out of app