refacto connection design