modify document structure