simplify key check