Improved positioning and sizing of elements