by defining a generic derived class and moving optional member variables there. this essentially addresses the issue of #1767.