Moved class definitions out of before hooks.