Starting the refactory of the type checker