Replace a whole bunch of stuff with a template function.
Replace a whole bunch of stuff with a template function.

sidmutha/SDC,UplinkCoder/SDC,UplinkCoder/SDC,schancel/SDC,DmitryOlshansky/SDC,DmitryOlshansky/SDC,bpr/SDC,deadalnix/SDC,carlor/SDC,sidmutha/SDC,SDC-Developers/SDC,schancel/SDC,schancel/SDC,JohanEngelen/SDC,DmitryOlshansky/SDC,bpr/SDC,sidmutha/SDC,JohanEngelen/SDC,deadalnix/SDC,SDC-Developers/SDC,bpr/SDC,UplinkCoder/SDC,JohanEngelen/SDC,deadalnix/SDC,SDC-Developers/SDC