this is too much for one class to do. It should be refactored.
we shouldn't arbitrarily use a thread.