Refactor CheckType to use IContext