Refactor to reflection/ty.Check