Cleaned up code for adding and editing a scheduledReport