fixed codesmells and template support for twig/smarty