Separated UI and logic.