Formatting and performance improvements