Suggestion: Remove all specific code from admin/payment.php. Define interfaces and an abstract class that need to be implemented by new payment gateways.