Refactor type check to a behaviour check