Refactor to simplify port interface