Refactoring thread pool executor