Replaced ```loop.run_in_executor``` with ```asyncio.to_thread``` for improved readability and consistency.