refactor demo code to optimize a bunch of postage stamps and collect stats