performance tuning, refactored run-orelse* functions