refacrored helper_patch