refactoring advanced reports