small improvement to way the way attributes are set