refactoring the threads into a class, and moving that to utils