Tied model to view and cleaned up onLogin