improve "let" function