Improve attribute handling