refactored for easier demo