Refactored some internal hook methods for clarity.
added comment.