simplify read_attribute handling