refactoring, use phptemplater instead of twig