Refactored boxes example