Move arg parser out of main function