Refactor from Thread to Executor