remove unused code and modify the thread catch exception to throwable