refactored the demoLibrary significantly