refactor some code & add ip format control & improve UI Error display