optimized home detect.