more efficient maybe-class-literal impl