refactored dupe validate password code into common area