mgj : login mechanizm refactored