Improve automatic switch