Refactored complete TypeChecker visitor code