simplify demo code