revising hooks, moving around functions for consistency