Improve layout performance