refactor. Replace lo dash template with swig
implement template extension
refactor code, add test template