reformat code samples
re-org pools, aggregation and block structure