If possible, we should make a method that evaluates the above logic and returns pending ops and application.rb/calculate_ops() , ChangeMaxUntrackedStorageOpGroup can reuse the method with appropriate params.