improve macro to insert strings to buffer