Write_Blueflood cleanup

@dlobue I tried combining them, but looks much cleaner if it is separate.