login dialog & db refactor