processing inside template