moved to a helper function

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>