change users attr to array, move looping logic out of script, & increase idempotence