various cleanup, make argument parser more functional