finish connection sequence and clean code