I think this logic combined with the if condition below the execution makes it a bit complex which is alright if we have enough test coverage for it.