Factoring the types and messages