Improved address formatting code