refactoring TypeChecker