cleaning and adjusting layout