NSD-move variables from global to local scope, and update markup to pass validation