Prototype aggregate by function