building classes for document