move login dialog to separate class to improve testability