cleaning up connection managment