templates: add keys, size fields to class