fix nested function jshint issue
factor out mandatory attribute check
build artifacts