refactoring to use ExecutorService