Removed duplicate code of setting curl args.