main: added support for plugins
tpl: added support for plugins