Improve verification logic