Modularize demo scripts