Moved hash and salt function to Helper class.