move to swig template engine