refactored unit tests to not take port as an arg