refactor login/logout to Views