added crypt passwords in database
refactored