refactor test/run.js for brevity