Service

1. Refactor the findPort function: clearly separate the finding logic for int type and string type

2. Refactor the findPort test: use table driven test approach

The value returned when err != nil is garbage anyway.