fix commander port parsing, add a few comments, rearrange some methods