introduce helper function