think it would be nice to pull this out into a separate function