added some inplace template methods