modularized pass check and made reusable