refactor program options out of main()