changed password encryption to good one, refactoring