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

yea. same thing happens for the original implementation. i will add a test to catch this.