rearrange code\nmove connection related code to 'cnxn' service