Optimize check terminal types