Small reogranization. Group type definitions with their impls.