connect the logic and UI