fix japanlaw-path problem
refactor `pop' idiom