Use detect instead of some take_while; Use all? and any? block