Refactor several functions to the "test.js" file.