orginizing ui state management