Make type resolution a bit more efficient