Refactored calculate_daily_quality_adjustment method, rearranged file a bit