Factor out regularizer class