Code reuse

made this into helper