move context.register in register_class