Refactor password hash checking into an instance method