Port refactoring