more refactoring; port argument should be an integer coming in