Update Database classes
add templates support