Some Refactoring and some generalized chunkloading handling