Avoid duplicating this logic in multiple places.
It returns an object with details, not just a simple boolean.