Refactored code and removed duplicate demo code