Refactor test with 'let'