renaming and cleaning demo code