refactoring and making demo ready