refactored to create the two objects, Context and Connection