Moved the chunkify to a seperate module
Refactored for a simpler logic