Refactor string format sample.