Reorganized the classes and added chunking