It makes me sad to have this in every single backend, is there any better way to factor this out?