decoupling refactor