reworked UI state handling (more centralized)