Moved example specific code into separate js file