add decoupling code