Added extraction functions with aggregation.