Removes some threading code