Generalize RPC functions inside a transport

Hope you like it!