Generified interfaces. Added further type safety.