factor out duplicate code for creating BoxItems into factory functions