Improve isMobile method