refactor to use let()