Removing code duplicity in report controller