refactor popup to use sanboxed templating area so report can be more manageable