Cleaned up multithreading managing