Optimize addAttributes to be a void function