Merchant array adapter
Refactoring and fix bugs