move string formatting codes into utility class