Refactoring Tests.js