Clean separation between logic and gui code