Clean up & Added connection code