Refactor tests with let