server port refactoring