Extract helper out