replaced Thread with ExecutorService for modernizing