Move to swig templates