We can probably move this to a generic function as well? I can imagine us adding more checks like this in the future.