Added templates support