Refactored project into library and demo project