preparing util functions to parse ports