renamed helper function