improve layout performance