Refactoring Type System