Instead of having a separate "dirty" flag, just check if supplied content is not an empty string.