cleaning up the password management code