Move the flag count to a helper which is easier to test and re-use.
Attach a file by drag & drop or click to upload