Factoring out a types regex.