Refactoring hook tracking. Fixed warnings