Refactor and added magento configurations