minor modifications to ensure class only gets declared once