externalized the password rewriting