improve attribute handling