Add support for custom base class