refactoring of passwd.rb