complex with templates