Refactoring and Type Extraction