Change stream dynamically

So I want to change stream dynamically (ESP12E) without writing two Times the same thing like Serial.print("ABC");server.print("ABC");

Is there a method to do this? I.e. I want to dynamically change stream from Serial to ServerClient without unnescesarily large amounts of code.

Is there a method to do this?

Yes. Serial, EthernetClient, and EthernetServer all derive, indirectly, from Print, so you could define a Print * pointer that pointed to a Serial, client, or server instance.