To avoid this perhaps Exploit::CmdStager should contain an object of type (CmdStager::Type) which the CmdStagers inherit from. We can then replace this object easily.