Cleanup attribute setting functions a bit.