s/deep_check/deep_apply/g; some refactoring.