refactor for chrome api decoupling