lrun.rb: futher refactor