Partially refactored demo app.