Fixes issue #27
Refactor a bit
Hotfix password validation