Chore: refactor code (#12113)
Chore: refactor code (#12113)

* Chore: refactor code

* Fix: minor tweak

* Minor tweak

* Fix: lint

* Fix: minor tweak

have deps as a Set rather than an array

* Fix: tweak

* fix: typo

whitneyit/eslint,whitneyit/eslint,Trott/eslint,DavidAnson/eslint,platinumazure/eslint,platinumazure/eslint,Moeriki/eslint,DavidAnson/eslint,pvamshi/eslint,Moeriki/eslint,Trott/eslint,eslint/eslint,onurtemizkan/eslint,pvamshi/eslint,eslint/eslint,onurtemizkan/eslint