Optimize call to canOpenURL: to improve performance
Cleaning @garnett's code