I know you do not touch it, but you assign to variable `encrypted` above exactly same value, so this code can look like
```
umap["password"] = crypt_password(umap["password"]) if encrypted
```