do you think this belongs in the library? it seems specific to our use case