might want to pull this elsewhere as many different implementations might use this. maybe a trait perhaps?
similar to what repo.rs looked like