refactor http connect and add conn.disconnect()