Improve UI layout management