Refactor classes and methods to decouple the Core library from Magento more fluently