Login refactored to use new models