I would get rid of this function and just use the same code directly in the two places that call it.