Use interfaces instead of classes for typehinting.

Allows to greater flexbility.