simplify maintain connections code.