Applied DRY to  loadCards()