Works with activemerchant 1.29.3
Minor refactoring and modifications