code for operation, aggregation, and cleanup steps