refactoring tester.js