made type checks more efficient