improvements to previous commit on replacing placeholder values