renamed `data` to `type`