Improve password complexity code after review