portable refactoring