Changed pointer types to base class

Actually seems not being painful and actually works. @scunz Can you please verify, this is ok?