Refactored and fixed few bugs

Refactored and fixed few bugs:
- Removed mandatory password
- Added password and dns name validation