Chunking stuff and cleanup