adding cleaning features so that attributes do not render if data is null