refine create_connection