Cleaned up Connection code