restructured a bit for js tests