modified c templater to use tokens