This piece of code is duplicated is couple of places. I noticed you do that when you try to create storage account, if that's the case I'd suggest that you create a new class `StorageUtilities` in `Commands.Common.Storage` and encapsulate the logic to create the storage account there which will include the `fileEndpoint` check also