Refined port-selection process