rearranged, refactored scripts - got AppConfig to work properly in GetOpt mode