factoring out a string append operation as a macro