switch to swig templating