refactoring
more general type definitions