refactor curl.xtm lib