factor this out
use our existing implementation here