Class definition and instantiation helper.