refactor resourceName split, support custom port