Better connection and model handling