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

likewise, you'll return 0, nil here, which is invalid.