added a cmd_ext to the analysis plugin, refactored code