Refactored solveReferences in ChunkWord.