better ui logic