Refactoring twigs