REfactoring
Improved type definitions