Refactoring locality reproduction with threads