Changing hooks as per class declaration