Removed redundant threading code.