refactor box creation into box class; some other refactorings of box/tool modules