Use intermediate vars to decrease minified size

Closure compiler applied to exports.visitModel shows a decrease from 1005 bytes down to 930 bytes.