Updates box classes.
Refactors box algorithm into separate smaller classes.