Refactor, create BoundBoxWriter, clean code.