refactoring next thread