You can get away with just if $purge_preferences { here because it'll check for true as the default.  Minor nitpick, feel free to ignore this one. :)