using template-like replacement