Improved the approach to judge the type of a Statement.