split demo functions to different javascript file