NOJIRA:  Refactor structure transform to be more organized, readable, and idiomatic;  this version is functionally IDENTICAL to the previous