controller: move test code to public demo() function