refactor: @tmpdir: create tmp/ dir automatically using File::Temp::tempdir
more refactoring