Adding classes to elements and rearrange spacing