ECM Refactor

I did not experience any problem but please do check it...