Refactor expected_output.js