Remove duplicated imports
Improve AppKit availability checks