Twig implementation (class changes and cleanup)