threadLocal et refactoring