used three level template inheritance