this feels like an odd place to be doing this.

i think it could be improved by at least writing a `get_or_create` style function and calling that (so that if we want to do something similar elsewhere this logic isn't reproduced in a bunch of places)