Working version of decoupling scripts
Next step is adding MBI functionality