rename a constant to more descriptive name
improve temp filename validation