simplify code with let