improved temporary file handling

WIP_FILENAME is now defined only once, with the others constants.