refactor connection
  refactor  code