refactored my authnet code