Use exists() rather than count() for efficiency.