I have a bunch of D7 code that works with classes. I know hooks cannot be invoked when they contain logic, such as class instantiations. Should I keep on trying to convert the other code, which relies on classes and the registry, or won't that work?