added createTemplate function with defaults