Clear and add attributes