Formatting and remove extra lines