use a named tuple for attributes
use printf to set local scoped vars lower in the stack

Avoids problems with bash 4.3