Split out typing preds, various refactoring.