Refactor passwords module.