Refactor related to Engine thread pool, preparing for cleanup.