add classes, fill attributes