refactoring chunk files