Refactor with Executor instead of Thread