use a helper function