Abstract away flow control related functions into reusable utility module.
Upsert cluster- and grade aggregation serially.