split out into utils