Comment is now dead but I&#x27;d significantly refactor this code where I wouldn&#x27;t be using nulls or empty strings as program flow control. At the very least I&#x27;d have an enum that was very explicit of what action I should be taking ie TEXT, PHOTO, VIDEO, etc.<p>The logic is too mixed up and this method does too many things. Off the top of my head you might refactor it so that inspection, classification, validation, preparation, etc all happen separately, right now this method does them all and then some.