attempt at reducing code size for checks