Formatting and template fixing