Move all profile data manipulation to the lambda.

This is so that when we add parent geom data to the mix the same calculations can be performed on the parent data, too.