Improve demo app to be more flexible.