twig refactoring part1