changed workflow of loginview, main, model