Changed aggregation cursor to be prototype based