Fix the error in payment factory. + some minor impr.