Better Twig view implementation and small fixes