using templates instead of string building