Pass classes in, rather than instances, to make restart work with user-defined classes