Changed port search utilities to use a data structure instead of a fixed-format string.