make the example code more simplify