library handling, temp dir factories