changed LayerTemplate to LayerDefinition