more password.c related refactoring