Merge "Refactor of the bugreport code."