updated templates to be more flexible