move into it's own function