optimising layout