Template system improved