merged refactor demo code into solution branch