Added index property to ProtoBase and refactored the key method to use it.