password no more plain text, general refactoring and better password handling