refactor to use one port
refactoring...