moving logic here for centralized verification