refactored the add report code