* refactor: simplify the code * fix: fix data race * refactor: simplify the code * refactor: simplify the code