demo page, class rewrite, and code style fixes