optimize the example