optimize utils/helpers functions