Refactor without any_fail variable