Factored out string constants and implemented a string format function