Refactor tmp files settings