Refactored tutorlib/passwordialogs