extract Box class to its own file