Better curl code