Some refactoring + using md5 for passwords