extract a isKeyFrame method