Optimized the way associations are created through edges