condensed main method in demos