Move chunk and entity wrapper code